﻿using System.Web;
using System.Web.Optimization;
using Test.MVC;

namespace Test.Web
{
    public class BundleConfig
    {
        //有关绑定的详细信息，请访问 http://go.microsoft.com/fwlink/?LinkId=301862
        //public static void RegisterBundles(BundleCollection bundles)
        //{
        //    bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
        //                "~/Scripts/jquery-{version}.js"));

        //    bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(
        //                "~/Scripts/jquery.validate*"));

        //    使用要用于开发和学习的 Modernizr 的开发版本。然后，当你做好
        //    生产准备时，请使用 http://modernizr.com 上的生成工具来仅选择所需的测试。
        //    bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(
        //                "~/Scripts/modernizr-*"));

        //    bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(
        //              "~/Scripts/bootstrap.js",
        //              "~/Scripts/respond.js"));

        //    bundles.Add(new StyleBundle("~/Content/css").Include(
        //              "~/Content/bootstrap.css",
        //              "~/Content/site.css"));
        //}


        /// <summary>
        /// jquery js包
        /// </summary>
        public const string JsJQueryBundle = "~/bundles/jquery";
        /// <summary>
        /// jquery validate js包 （验证）
        /// </summary>
        public const string JsJQueryValidateBundle = "~/bundles/jqueryval";

        /// <summary>
        /// modernizr js包（Modernizr 是一个用来检测浏览器功能支持情况的 JavaScript 库。）
        /// </summary>
        public const string JsModernizrBundle = "~/bundles/modernizr";

        /// <summary>
        /// bootstrap包
        /// </summary>
        public const string JsAdminBundle = "~/bundles/scripts/admin";

        /// <summary>
        /// Content Css包，通用样式
        /// </summary>
        public const string CssAdminBundle = "~/bundles/css/admin";

        /// <summary>
        /// Bootstrap Upload Css（Bootstrap 上传样式）
        /// </summary>
        public const string BootstrapUploadCssBundle = "~/bundles/BootstrapUpload/css";

        /// <summary>
        /// Bootstrap Upload Js（Bootstrap 上传脚本）
        /// </summary>
        public const string BootstrapUploadJsBundle = "~/bundles/BootstrapUpload/js";

        /// <summary>
        /// bootstrap-fileinput-krajee Css（文件上传样式）
        /// </summary>
        public const string BootstrapUploadKrajeeCssBundle = "~/bundles/BootstrapUploadKrajee/css";

        /// <summary>
        /// bootstrap-fileinput-krajee Js
        /// </summary>
        public const string BootstrapUploadKrajeeJsBundle = "~/bundles/BootstrapUploadKrajee/js";

        /// <summary>
        /// jQuery Upload Css（jQuery 上传样式）
        /// </summary>
        public const string JQueryUploadCssBundle = "~/bundles/jQueryUpload/css";

        /// <summary>
        /// jQuery Upload Js
        /// </summary>
        public const string JQueryUploadJsBundle = "~/bundles/jQueryUpload/js";

        /// <summary>
        /// fancybox css（弹出展示图片样式）
        /// </summary>
        public const string FancyboxCssBundle = "~/bundles/fancybox/css";

        /// <summary>
        /// fancybox js
        /// </summary>
        public const string FancyboxJsBundle = "~/bundles/fancybox/js";

        /// <summary>
        /// migrate js（将较旧的jQuery代码迁移到jQuery 3.0+）
        /// </summary>
        public const string JQueryMigrateJsBundle = "~/bundles/migrate/js";

        public const string UEditorFull = "~/bundles/ueditor/ueditorfull";

        public const string UEditorSimple = "~/bundles/ueditor/ueditorsimple";

        public static void RegisterBundles(BundleCollection bundles)
        {
            BundleTable.EnableOptimizations = !MvcApplication.IsDebug;

            //取消忽略列表
            BundleTable.Bundles.IgnoreList.Clear();
            BundleTable.Bundles.IgnoreList.Ignore("*.intellisense.js");
            BundleTable.Bundles.IgnoreList.Ignore("*-vsdoc.js");
            //BundleTable.Bundles.IgnoreList.Ignore("*.debug.js", OptimizationMode.WhenEnabled);

            //取消如果有min文件，就直接使用的功能（为了转换路径）
            BundleTable.Bundles.FileExtensionReplacementList.Clear();


            bundles.Add(new ScriptBundle(JsJQueryBundle).Include(
                        "~/js/jquery-1.12.0.js"));

            bundles.Add(new ScriptBundle(JsJQueryValidateBundle).Include(
                        "~/js/jquery.validate.js",
                        "~/js/jquery.validate.unobtrusive.js"));

            bundles.Add(new ScriptBundle(JsModernizrBundle).Include(
                        "~/js/modernizr-2.8.3.js"));

            bundles.Add(new ScriptBundle(UEditorFull).Include(
                        "~/js/ueditor/ueditor.config.full.js",
                        "~/js/ueditor/ueditor.all.js",
                        "~/js/ueditor/lang/zh-cn/zh-cn.js"));

            bundles.Add(new ScriptBundle(UEditorSimple).Include(
                        "~/js/ueditor/ueditor.config.simple.js",
                        "~/js/ueditor/ueditor.all.js",
                        "~/js/ueditor/lang/zh-cn/zh-cn.js"));

            #region Admin

            bundles.Add(new ResolveUrlStyleBundle(CssAdminBundle)
                .Include("~/css/admin/font-awesome/css/font-awesome.css")
                .Include("~/css/bootstrap.css")
                .Include("~/js/plugins/uniform/css/uniform.default.css")
                //PAGE LEVEL PLUGIN STYLES 页面级插头样式
                .Include("~/js/plugins/bootstrap-toastr/toastr.css",
                        "~/js/plugins/bootstrap-modal/css/bootstrap-modal.css",
                        //"~/js/plugins/bootstrap-modal/css/bootstrap-modal-bs3patch.css",
                        "~/js/plugins/gritter/css/jquery.gritter.css",
                        "~/js/plugins/bootstrap-datetimepicker/css/datetimepicker.css",
                        "~/js/plugins/bootstrap-daterangepicker/daterangepicker-bs3.css",
                        "~/js/plugins/fullcalendar/fullcalendar/fullcalendar.css",
                        "~/js/plugins/jqvmap/jqvmap/jqvmap.css",
                        "~/js/plugins/jquery-easy-pie-chart/jquery.easy-pie-chart.css",
                        "~/js/plugins/select2/css/select2.css",
                        "~/js/plugins/bootstrap-treeview/css/bootstrap-treeview.css",
                        "~/js/plugins/bootstrap-switch/static/stylesheets/bootstrap-switch-conquer.css",
                        "~/js/plugins/jquery-nestable/jquery.nestable.css",
                        "~/js/plugins/jquery-multi-select/css/multi-select.css",
                        //THEME STYLES 主题样式
                        "~/css/admin/css/style-conquer.css",
                        "~/css/admin/css/style.css",
                        "~/css/admin/css/style-responsive.css",
                        "~/css/admin/css/plugins.css",
                        "~/css/admin/css/themes/default.css",
                        //custom css 定制样式
                        "~/css/admin/css/custom.css"));

            bundles.Add(new ScriptBundle(JsAdminBundle).Include(
                        "~/js/plugins/globalize/globalize.js",
                        //"~/js/moment-with-locales.js",
                        //CORE CSS
                        "~/js/plugins/jquery-ui/jquery-ui-1.10.3.custom.min.js",
                        "~/js/bootstrap.js",
                        "~/js/plugins/bootstrap-hover-dropdown/twitter-bootstrap-hover-dropdown.min.js",
                        "~/js/plugins/jquery-slimscroll/jquery.slimscroll.min.js",
                        "~/js/plugins/jquery.blockui.min.js",
                        "~/js/plugins/jquery.cokie.min.js",
                        "~/js/plugins/uniform/jquery.uniform.min.js",
                        //PAGE LEVEL CSS 页面级CSS
                        "~/js/plugins/jqvmap/jqvmap/jquery.vmap.js",//地图插件
                                                                    //"~/js/plugins/jqvmap/jqvmap/maps/jquery.vmap.russia.js",
                                                                    //"~/js/plugins/jqvmap/jqvmap/maps/jquery.vmap.world.js",
                                                                    //"~/js/plugins/jqvmap/jqvmap/maps/jquery.vmap.europe.js",
                                                                    //"~/js/plugins/jqvmap/jqvmap/maps/jquery.vmap.germany.js",
                                                                    //"~/js/plugins/jqvmap/jqvmap/maps/jquery.vmap.usa.js",
                                                                    //"~/js/plugins/jqvmap/jqvmap/data/jquery.vmap.sampledata.js",
                        "~/js/plugins/jquery.peity.min.js",
                        "~/js/plugins/jquery.pulsate.min.js",
                        "~/js/plugins/jquery.confirm.min.js",
                        "~/js/plugins/jquery-knob/js/jquery.knob.js",
                        "~/js/plugins/flot/jquery.flot.js",
                        "~/js/plugins/flot/jquery.flot.resize.js",
                        "~/js/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js",
                        "~/js/plugins/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js",
                        "~/js/plugins/bootstrap-daterangepicker/moment.min.js",
                        "~/js/plugins/bootstrap-daterangepicker/daterangepicker.js",
                        "~/js/plugins/gritter/js/jquery.gritter.js",
                        "~/js/plugins/fullcalendar/fullcalendar/fullcalendar.min.js",
                        "~/js/plugins/jquery-easy-pie-chart/jquery.easy-pie-chart.js",
                        "~/js/plugins/jquery.sparkline.min.js",
                        "~/js/plugins/select2/js/select2.js",
                        "~/js/plugins/select2/js/i18n/zh-CN.js",
                        "~/js/plugins/jquery-multi-select/js/jquery.multi-select.js",
                        "~/js/plugins/jquery-multi-select/js/jquery.quicksearch.js",
                        //"~/js/plugins/datatables/media/js/jquery.dataTables.min.js",
                        //"~/js/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.js",
                        //"~/js/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js",
                        //"~/js/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js",
                        //"~/js/plugins/ckeditor/ckeditor.js",
                        //"~/js/plugins/bootstrap-fileinput/bootstrap-fileinput.js",
                        "~/js/plugins/bootstrap-switch/static/js/bootstrap-switch.js",
                        "~/js/plugins/bootstrap-toastr/toastr.js",
                        "~/js/plugins/bootstrap-modal/js/bootstrap-modalmanager.js",
                        "~/js/plugins/bootstrap-modal/js/bootstrap-modal.js",
                        //"~/js/plugins/bootstrap-select/bootstrap-select.js",
                        "~/js/plugins/bootstrap-treeview/js/bootstrap-treeview.js",
                        "~/js/plugins/jquery-nestable/jquery.nestable.js",

                        //CUSTOM CSS
                        "~/js/admin/app.js",
                        //"~/js/admin/dataseletor.js"
                        "~/js/common/jquery.unionSelect.js",
                        "~/js/common/jquery.unionSelect.config.js",
                        "~/js/jquery.form.js",
                        "~/js/recoob/recoob.bBase.js"
                        ));

            #endregion Admin

            bundles.Add(new ScriptBundle(BootstrapUploadJsBundle).Include(
                        "~/js/plugins/bootstrap-fileupload/bootstrap-fileupload.js"));

            bundles.Add(new ResolveUrlStyleBundle(BootstrapUploadCssBundle).Include(
                        "~/js/plugins/bootstrap-fileupload/bootstrap-fileupload.css"));

            bundles.Add(new ScriptBundle(BootstrapUploadKrajeeJsBundle).Include(
                        "~/js/plugins/bootstrap-fileinput-krajee/js/plugins/canvas-to-blob.js",
                        "~/js/plugins/bootstrap-fileinput-krajee/js/fileinput.js",
                        "~/js/plugins/bootstrap-fileinput-krajee/js/fileinput_locale_zh.js"));

            bundles.Add(new ResolveUrlStyleBundle(BootstrapUploadKrajeeCssBundle).Include(
                        "~/js/plugins/bootstrap-fileinput-krajee/css/fileinput.css"));

            bundles.Add(new ScriptBundle(BootstrapUploadJsBundle).Include(
                        "~/js/plugins/bootstrap-fileupload/bootstrap-fileupload.js"));

            bundles.Add(new ResolveUrlStyleBundle(BootstrapUploadCssBundle).Include(
                        "~/js/plugins/bootstrap-fileupload/bootstrap-fileupload.css"));

            bundles.Add(new ScriptBundle(JQueryUploadJsBundle).Include(
                    "~/js/plugins/jquery-file-upload/js/vendor/jquery.ui.widget.js",
                    "~/js/plugins/jquery-file-upload/js/vendor/tmpl.min.js",
                    "~/js/plugins/jquery-file-upload/js/vendor/load-image.min.js",
                    "~/js/plugins/jquery-file-upload/js/vendor/canvas-to-blob.min.js",
                    "~/js/plugins/jquery-file-upload/js/jquery.iframe-transport.js",
                    "~/js/plugins/jquery-file-upload/js/jquery.fileupload.js",
                    "~/js/plugins/jquery-file-upload/js/jquery.fileupload-process.js",
                    "~/js/plugins/jquery-file-upload/js/jquery.fileupload-image.js",
                    "~/js/plugins/jquery-file-upload/js/jquery.fileupload-audio.js",
                    "~/js/plugins/jquery-file-upload/js/jquery.fileupload-video.js",
                    "~/js/plugins/jquery-file-upload/js/jquery.fileupload-validate.js",
                    "~/js/plugins/jquery-file-upload/js/jquery.fileupload-ui.js"));

            bundles.Add(new ResolveUrlStyleBundle(JQueryUploadCssBundle).Include(
                    "~/js/plugins/jquery-file-upload/css/jquery.fileupload-ui.css"));

            bundles.Add(new ResolveUrlStyleBundle(FancyboxCssBundle).Include(
                "~/css/admin/css/pages/portfolio.css",
                "~/js/plugins/fancybox/source/jquery.fancybox.css"));

            bundles.Add(new ResolveUrlStyleBundle(FancyboxJsBundle).Include(
                "~/js/plugins/jquery-migrate-1.2.1.min.js",
                "~/js/plugins/jquery-mixitup/jquery.mixitup.min.js",
                "~/js/plugins/fancybox/source/jquery.fancybox.pack.js"));

            //bundles.Add(new ResolveUrlStyleBundle(BootstrapDatetimePickerCssBundle).Include());

            //bundles.Add(new ScriptBundle(BootstrapDatetimePickerJsBundle).Include(
            //    "~/js/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js",
            //    "~/js/plugins/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"));
        }
    }
}

